package com.bm.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName ejyy_user_building
 */
@TableName(value ="ejyy_user_building")
@Data
public class EjyyUserBuilding implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 
     */
    private Long buildingId;

    /**
     * 
     */
    private Long wechatMpUserId;

    /**
     * 
     */
    private Boolean authenticated;

    /**
     * 1 实名信息自行关联；2 物业公司认证 3 业主认证
     */
    private Byte authenticatedType;

    /**
     * 根据type查询认证用户
     */
    private Long authenticatedUserId;

    /**
     * 1 正常；0 解绑
     */
    private Byte status;

    /**
     * 
     */
    private Long createdAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EjyyUserBuilding other = (EjyyUserBuilding) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getBuildingId() == null ? other.getBuildingId() == null : this.getBuildingId().equals(other.getBuildingId()))
            && (this.getWechatMpUserId() == null ? other.getWechatMpUserId() == null : this.getWechatMpUserId().equals(other.getWechatMpUserId()))
            && (this.getAuthenticated() == null ? other.getAuthenticated() == null : this.getAuthenticated().equals(other.getAuthenticated()))
            && (this.getAuthenticatedType() == null ? other.getAuthenticatedType() == null : this.getAuthenticatedType().equals(other.getAuthenticatedType()))
            && (this.getAuthenticatedUserId() == null ? other.getAuthenticatedUserId() == null : this.getAuthenticatedUserId().equals(other.getAuthenticatedUserId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getBuildingId() == null) ? 0 : getBuildingId().hashCode());
        result = prime * result + ((getWechatMpUserId() == null) ? 0 : getWechatMpUserId().hashCode());
        result = prime * result + ((getAuthenticated() == null) ? 0 : getAuthenticated().hashCode());
        result = prime * result + ((getAuthenticatedType() == null) ? 0 : getAuthenticatedType().hashCode());
        result = prime * result + ((getAuthenticatedUserId() == null) ? 0 : getAuthenticatedUserId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", buildingId=").append(buildingId);
        sb.append(", wechatMpUserId=").append(wechatMpUserId);
        sb.append(", authenticated=").append(authenticated);
        sb.append(", authenticatedType=").append(authenticatedType);
        sb.append(", authenticatedUserId=").append(authenticatedUserId);
        sb.append(", status=").append(status);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}